package view;

import java.io.File;

import javax.swing.JFileChooser;

import main.KeyDefinitions;


public class FileLoad extends JFileChooser{
	KeyDefinitions keyDefs;
	public FileLoad(KeyDefinitions _keyDefs,EditControlView ecv){
		keyDefs = _keyDefs;
		int option = this.showOpenDialog(this);
		if(option == JFileChooser.APPROVE_OPTION){
			File file = this.getSelectedFile();
			keyDefs.loadKeyDefinitions(file);
			ecv.updateButtonText();
		}
		else{
			this.getParent().remove(this);
		}
	 }
}
	

